]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Drop CoglError for GError
authorNiels De Graef <nielsdegraef@gmail.com>
Thu, 20 Jun 2019 08:12:16 +0000 (10:12 +0200)
committerNiels De Graef <niels.degraef@barco.com>
Thu, 20 Jun 2019 14:30:40 +0000 (16:30 +0200)
From https://gitlab.gnome.org/GNOME/mutter/merge_requests/631

```
CoglError was added at a certain point to remove the hard dependency on
GLib, but since this can't be avoided inside mutter, let's remove this
whole abstraction.
```

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/586

src/st/st-private.c
src/st/st-theme-node-drawing.c
src/st/st-theme-node-transition.c

index c5add4b1d4680c1e1f458a8a53c44e03165b29df..a9ca90644be3f95abc26015261f8a53ce78103e2 100644 (file)
@@ -362,7 +362,7 @@ _st_create_shadow_pipeline (StShadow    *shadow_spec,
 {
   ClutterBackend *backend = clutter_get_default_backend ();
   CoglContext *ctx = clutter_backend_get_cogl_context (backend);
-  CoglError *error = NULL;
+  GError *error = NULL;
 
   static CoglPipeline *shadow_pipeline_template = NULL;
 
@@ -398,7 +398,7 @@ _st_create_shadow_pipeline (StShadow    *shadow_spec,
   if (error)
     {
       g_warning ("Failed to allocate texture: %s", error->message);
-      cogl_error_free (error);
+      g_error_free (error);
     }
 
   g_free (pixels_out);
@@ -466,7 +466,7 @@ _st_create_shadow_pipeline_from_actor (StShadow     *shadow_spec,
       CoglFramebuffer *fb;
       CoglContext *ctx;
       CoglColor clear_color;
-      CoglError *catch_error = NULL;
+      GError *catch_error = NULL;
       float x, y;
 
       ctx = clutter_backend_get_cogl_context (clutter_get_default_backend ());
@@ -480,7 +480,7 @@ _st_create_shadow_pipeline_from_actor (StShadow     *shadow_spec,
 
       if (!cogl_framebuffer_allocate (fb, &catch_error))
         {
-          cogl_error_free (catch_error);
+          g_error_free (catch_error);
           cogl_object_unref (offscreen);
           cogl_object_unref (buffer);
           return NULL;
index 9877afdae050e464b617a867d9773b1b8fe67c94..e3bbdcd656186eb3b8a5f2fdfaa0a4b452342776 100644 (file)
@@ -72,7 +72,7 @@ create_corner_material (StCornerSpec *corner)
 {
   ClutterBackend *backend = clutter_get_default_backend ();
   CoglContext *ctx = clutter_backend_get_cogl_context (backend);
-  CoglError *error = NULL;
+  GError *error = NULL;
   CoglTexture *texture;
   cairo_t *cr;
   cairo_surface_t *surface;
@@ -184,7 +184,7 @@ create_corner_material (StCornerSpec *corner)
   if (error)
     {
       g_warning ("Failed to allocate texture: %s", error->message);
-      cogl_error_free (error);
+      g_error_free (error);
     }
 
   g_free (data);
@@ -1007,7 +1007,7 @@ st_theme_node_prerender_background (StThemeNode *node,
 {
   ClutterBackend *backend = clutter_get_default_backend ();
   CoglContext *ctx = clutter_backend_get_cogl_context (backend);
-  CoglError *error = NULL;
+  GError *error = NULL;
   StBorderImage *border_image;
   CoglTexture *texture;
   guint radius[4];
@@ -1344,7 +1344,7 @@ st_theme_node_prerender_background (StThemeNode *node,
   if (error)
     {
       g_warning ("Failed to allocate texture: %s", error->message);
-      cogl_error_free (error);
+      g_error_free (error);
     }
 
   cairo_destroy (cr);
@@ -2288,7 +2288,7 @@ st_theme_node_prerender_shadow (StThemeNodePaintState *state)
   int fb_width, fb_height;
   CoglTexture *buffer;
   CoglFramebuffer *offscreen = NULL;
-  CoglError *error = NULL;
+  GError *error = NULL;
 
   ctx = clutter_backend_get_cogl_context (clutter_get_default_backend ());
 
@@ -2351,11 +2351,8 @@ st_theme_node_prerender_shadow (StThemeNodePaintState *state)
       state->box_shadow_pipeline = _st_create_shadow_pipeline (st_theme_node_get_box_shadow (node),
                                                                buffer, state->resource_scale);
     }
-  else
-    {
-      cogl_error_free (error);
-    }
 
+  g_clear_error (&error);
   cogl_clear_object (&offscreen);
   cogl_clear_object (&buffer);
 }
index 7c38077119b0ed94f9e3750177b60cdd6900fce0..f35977a18183251310eaeacb75978c571e042904 100644 (file)
@@ -249,7 +249,7 @@ setup_framebuffers (StThemeNodeTransition *transition,
   StThemeNodeTransitionPrivate *priv = transition->priv;
   CoglContext *ctx;
   guint width, height;
-  CoglError *catch_error = NULL;
+  GError *catch_error = NULL;
 
   /* template material to avoid unnecessary shader compilation */
   static CoglPipeline *material_template = NULL;
@@ -277,7 +277,7 @@ setup_framebuffers (StThemeNodeTransition *transition,
   priv->old_offscreen = COGL_FRAMEBUFFER (cogl_offscreen_new_with_texture (priv->old_texture));
   if (!cogl_framebuffer_allocate (priv->old_offscreen, &catch_error))
     {
-      cogl_error_free (catch_error);
+      g_error_free (catch_error);
       cogl_clear_object (&priv->old_offscreen);
       return FALSE;
     }
@@ -286,7 +286,7 @@ setup_framebuffers (StThemeNodeTransition *transition,
   priv->new_offscreen = COGL_FRAMEBUFFER (cogl_offscreen_new_with_texture (priv->new_texture));
   if (!cogl_framebuffer_allocate (priv->new_offscreen, &catch_error))
     {
-      cogl_error_free (catch_error);
+      g_error_free (catch_error);
       cogl_clear_object (&priv->new_offscreen);
       return FALSE;
     }